CREATE TABLE [dbo].[TTATRI_SIST]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_MENU] [dbo].[TD_VC_020] NOT NULL,
[CO_ATRI] [dbo].[TD_VC_020] NOT NULL,
[NU_CORR_ATRI] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTATRI_SI__NU_CO__0E391C95] DEFAULT ((0)),
[TI_DATO_FECH] [dbo].[TD_VC_003] NULL,
[NU_ORDE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTATRI_SI__NU_OR__0F2D40CE] DEFAULT ((0)),
[NU_ATRI] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTATRI_SI__NU_AT__10216507] DEFAULT ((0)),
[CO_TBLS] [dbo].[TD_VC_020] NULL,
[CO_TBLS_APOY] [dbo].[TD_VC_020] NULL,
[CO_ATR1] [dbo].[TD_VC_020] NULL,
[CO_ATR2] [dbo].[TD_VC_020] NULL,
[DE_OBSE] [dbo].[TD_VC_200] NULL,
[ST_INFO_APOY] [dbo].[TD_VC_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTATRI_SI__CO_US__11158940] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTATRI_SI__FE_US__1209AD79] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TTATRI_SI__CO_US__12FDD1B2] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TTATRI_SI__FE_US__13F1F5EB] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTATRI_SIST] ADD CONSTRAINT [PK__TTATRI_S__181EEB4A369C13AA] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_MODU], [CO_MENU], [CO_ATRI], [NU_CORR_ATRI]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTATRI_SIST] ADD CONSTRAINT [FK__TTATRI_SIST__4B622666] FOREIGN KEY ([CO_SIST], [CO_MODU], [CO_MENU]) REFERENCES [dbo].[TMMENU] ([CO_SIST], [CO_MODU], [CO_MENU])
GO
ALTER TABLE [dbo].[TTATRI_SIST] ADD CONSTRAINT [FK__TTATRI_SIST__4C564A9F] FOREIGN KEY ([CO_SIST], [CO_TBLS]) REFERENCES [dbo].[TMTBLS_SIST] ([CO_SIST], [CO_TBLS])
GO
GRANT SELECT ON  [dbo].[TTATRI_SIST] TO [public]
GRANT INSERT ON  [dbo].[TTATRI_SIST] TO [public]
GRANT DELETE ON  [dbo].[TTATRI_SIST] TO [public]
GRANT UPDATE ON  [dbo].[TTATRI_SIST] TO [public]
GO
